﻿@using QDT.Common
@using QDT.Core
@using QDT.Core.Assignments
@using QDT.Core.Projects
@using QDT.MVC.UI
@using QDT.Web
@model IPagedList<Assignment>
@{
    ViewBag.Title = "转让列表";
}

<script src="@Url.Content("~/Content/Default/JS/change.js")" type="text/javascript"></script>
<link href="@Url.Content("~/Content/Default/CSS/CreditList.css")" rel="stylesheet" type="text/css" />

@Html.Action("_UserBanner")
<div class="ui-body">
    <div class="ui-inner">
        <div class="ui-grid-row">
            @Html.Action("UserMenu", new { route = MenuRoute.CreditAssignment })
            <div class="ui-grid-20">
                <div class="ui-box">
                    @Html.Partial("_CreditAssignment")
                    <div class="ui-table-container" style="height: 491px;">
                        <table style="width: 100%">
                            <thead>
                                <tr>
                                    <th style="padding-left: 50px;">
                                        项目信息
                                    </th>
                                    <th class="th-center">
                                        转让金额
                                    </th>
                                    <th class="th-center">
                                        待收本金
                                    </th>
                                    <th class="th-center">
                                        折让率
                                    </th>
                                    <th class="th-center">
                                        赎回金额
                                    </th>
                                </tr>
                            </thead>
                            <tbody id="datalist">
                                @foreach (var m in Model)
                                {
                                    Project project = Html.F().GetProject(m.ProjectId);
                                    <tr>
                                        <td class="td-first">
                                            <span><a href="@Url.Action("Index", "Project", new { id = project.ID })">@project.Name</a></span>
                                            <div style="line-height: 20px; color: #9d9d9d;">
                                                <span>预期年化收益率：</span><span>@project.Rate<span>%</span></span> &nbsp;&nbsp;<span>期限：</span><span><span>@project.RepayTime</span>个月</span><br />
                                               <span>投标时间：</span>@project.CreateTime<span></span> </div>
                                        </td>
                                        <td class="td-all">
                                            @m.Money.ToMoney()
                                        </td>
                                        <td class="td-all">
                                            @m.NeedMoney.ToMoney()
                                        </td>
                                        <td class="td-color">
                                           @m.DiscountRate %
                                        </td>
                                        <td class="td-all">
                                            @m.LoadMoney.ToMoney()
                                        </td>
                                    </tr>
                                }
                            </tbody>
                        </table>
                    </div>
                    <div style="text-align: center;">@Html.ClientPager(Model)</div>
                </div>
            </div>
        </div>
    </div>
</div>
<div style="margin-top: -10px;">
    @Html.Partial("_BindBottomImage")
</div>

<script type="text/javascript">
    $().ready(function () {
        var nav = "running";
        if (@(ViewBag.Status == AssignmentStatus.Completed ? "true":"false")) {
            nav = "over";
        }
        $("#ui-" + nav + " a").addClass("a_class");
        $("#CreditAssignment").css("background", "#e0524b");
        $("#CreditAssignment i,#CreditAssignment span").css("color", "white");
        $("#CreditAssignment .san-jiaoxing").css("display", "block");
    });
</script>